# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-django-nose
pkgname=('python2-django-nose' 'python-django-nose')
_pkgname=django-nose
pkgver=1.4.7
pkgrel=6
pkgdesc='Makes your Django tests simple and snappy.'
arch=('any')
url='https://pypi.org/project/django-nose/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('cbaca2d9c64f937860aa118985a1f9fe3cd7ac482fac1a84a10728e813c9a06b379da76e28c609c9f1e8775393be5d8542d7d53c2b0131e8a1b2f12df2d2225a')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-django-nose() {
  depends=('python2' 'python2-nose')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-django-nose() {
  depends=('python' 'python-nose')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

